var t = getApp();

Page({
    data: {},
    onLoad: function (e) {
        var a = this;
        console.log(e)
        wx.createSelectorQuery().select(".name").boundingClientRect(function (t) {
                a.setData({
                    nameHeight: t.bottom + "rpx"
                });
            }).exec(),
            wx.request({
                url: "https://zg99.offcn.com/index/chaxun/getlist/?actid=42754&callback=?",
                method: "get",
                data: {
                    zdy: e.zdy0,
                    phone: wx.getStorageSync('phone'),
                    limits: 2
                },
                success: function (t) {
                    var jsonStr = t.data;
                    jsonStr = jsonStr.replace("(", "");
                    jsonStr = jsonStr.replace(")", "");
                    if (typeof jsonStr != 'object') {
                        jsonStr = jsonStr.replace(/\ufeff/g, ""); //字符串转化JSON对象
                        var theJson = JSON.parse(jsonStr);
                    };
                    console.log(theJson.lists[0])
                    a.setData({
                        list0: theJson.lists[0]
                    })


                }
            }),
            wx.request({
                url: "https://zg99.offcn.com/index/chaxun/getlist/?actid=42754&callback=?",
                method: "get",
                data: {
                    zdy: e.zdy1,
                    phone: wx.getStorageSync('phone'),
                    limits: 2
                },
                success: function (t) {
                    var jsonStr = t.data;
                    jsonStr = jsonStr.replace("(", "");
                    jsonStr = jsonStr.replace(")", "");
                    if (typeof jsonStr != 'object') {
                        jsonStr = jsonStr.replace(/\ufeff/g, ""); //字符串转化JSON对象
                        var theJson = JSON.parse(jsonStr);
                    };
                    console.log(theJson)
                    a.setData({
                        list1: theJson.lists[0]
                    })

                }
            });
    },
    same: function () {
        this.setData({
            same: !this.data.same
        });
    },
    different: function () {
        this.setData({
            different: !this.data.different
        });
    },
    gozx: function () {
        wx.navigateTo({
          url: '../../xiaoneng/xiaoneng',
        })
    },
   /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {
        var area = wx.getStorageSync('area')
        var agent = wx.getStorageSync('agent')
        var page = wx.getStorageSync('page')
        return {
            title: '2021国家公务员招录考试职位表',
            path: 'pages/search/search/search?area=' + area + '&agent=' + agent + '&page=' + page
        }
    },
    /**分享到朋友圈*/
    onShareTimeline: function () {
        var area = wx.getStorageSync('area')
        var agent = wx.getStorageSync('agent')
        var page = wx.getStorageSync('page')
        return {
            title: '2021国家公务员招录考试职位表',
            path: 'pages/search/search/search?area=' + area + '&agent=' + agent + '&page=' + page
        }
    }
});